package com.zhihui.client.alarm.controller;

import com.zhihui.client.alarm.common.Lay;
import com.zhihui.client.alarm.common.Msg;
import com.zhihui.client.alarm.entity.Monitorpoint;
import com.zhihui.client.alarm.service.MonitorpointService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 控制器
 * @author zhihuian
 * @email 18037017565@163.com
 * @date 2018/10/29
 */
@Controller
@RequestMapping("/monitorpoint")
public class MonitorpointController {
    @Resource
    private MonitorpointService monitorpointService;

    @RequestMapping
    public String monitorpoint(){
        return "monitorpoint/monitorpoint.html";
    }
    @RequestMapping("/add")
    public String add(){
        return "monitorpoint/addMonitorpoint.html";
    }

    @RequestMapping("/update")
    public String update(){
        return "monitorpoint/updateMonitorpoint.html";
    }

    @RequestMapping("/getMonitorpoints")
    @ResponseBody
    public Lay getMonitorpoints(Monitorpoint monitorpoint,Integer page,Integer limit){
        return monitorpointService.getMonitorpoints(monitorpoint,page,limit);
    }
    @RequestMapping("/addMonitorpoint")
    @ResponseBody
    public Msg addMonitorpoint(Monitorpoint monitorpoint){
        return monitorpointService.addMonitorpoint(monitorpoint);
    }

    @RequestMapping("/updateMonitorpoint")
    @ResponseBody
    public Msg updateMonitorpoint(Monitorpoint monitorpoint){
        return monitorpointService.updateMonitorpoint(monitorpoint);
    }

    @RequestMapping("/delMonitorpoint")
    @ResponseBody
    public Msg delMonitorpoint(Monitorpoint monitorpoint){
        return monitorpointService.delMonitorpoint(monitorpoint);
    }
}
